import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import axios from 'axios'

Vue.config.productionTip = false
Vue.use(ElementUI)

// Configure axios
axios.defaults.baseURL = process.env.VUE_APP_API_URL || 'http://localhost:8080/api'
axios.interceptors.request.use(config => {
  const token = store.getters.token
  if (token) {
    config.headers['Authorization'] = `Bearer ${token}`
  }
  return config
})

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app') 